/**
 * Description: 
 * File: read_file.cpp |Time: 2022-05-09 15:05
 */

#include <iostream>
#include <fstream>

using namespace std;

int main(int argc, const char *argv[])
{
    char buf[128];
    string filename = "test.txt";
    ifstream fs(filename);
    if(!fs.is_open()) {
        cout << "Error while open file " << filename << endl;
        return -1;
    }
    while(!fs.eof()) {
        fs.getline(buf, 128);
        cout << "buf: " << buf << endl;
    }

    fs.close();

    return 0;
}


